<?php

class Index_SiteAction extends C_Action  
{
	private $user_E = null;
	private $site_E = null;
	private $current_room_E = null;
	private $RootOper = 0;
	private $is_login = 0;
	public function init()
	{
		$this->user_E = Zend_Registry::get("user_E");
		$this->site_E = Zend_Registry::get("site_E");
		$this->current_room_E = Zend_Registry::get("current_room_E");
		$this->RootOper = Zend_Registry::get('RootOper');
		$this->is_login = Zend_Registry::get('is_login');
	}
	public function doIndex()
	{ 
		$modsort = $this->current_room_E->modsort;
		$modsort = unserialize($modsort);
		if(!empty($modsort))
		{
			if(!empty($modsort['l']))
			{
				$modarray = explode(',',$modsort['l']);
				//print_r($modarray);
				foreach($modarray as $k => $l)
				{
					if(!empty($l))
					{
						$mod_E = Mods::getById($l);
						if(!empty($mod_E))
						$mod_list['l'][] = $mod_E;
					}
				}
			}
			
			if(!empty($modsort['r']))
			{
				$modarray = explode(',',$modsort['r']);
				foreach($modarray as $k => $r)
				{
					if(!empty($r))
					{
						$mod_E = Mods::getById($r);
						if(!empty($mod_E))
						$mod_list['r'][] = $mod_E;
					}
				}
			}
			$this->_response->mod_list = $mod_list;
		}
		
		//weibo jiekou
		if($this->is_login)
		{
			if(!Weibos::isFollow($this->site_E->mapUser->id))
			{
				$this->_response->isfollow = 0;
			}
			else
			{
				$this->_response->isfollow = 1;
			}
		}
		//
		$sina_follow_list  = Weibos::followers($this->site_E->mapUser->id);
		$this->_response->sina_follow_list = $sina_follow_list;
	}
	
}

?>
